<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta name="generator" content="Hugo 0.74.1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Flutter 1.12后 上传aar至maven私服 | caijinglong的博客</title>
    <meta property="og:title" content="Flutter 1.12后 上传aar至maven私服 - caijinglong的博客">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content="2020-02-04T18:23:24&#43;08:00">
        
        
    <meta property="article:modified_time" content="2020-02-04T18:23:24&#43;08:00">
        
    <meta name="Keywords" content="golang,go语言,flutter,caijinglong,java,android,博客,项目管理,python,软件架构,公众号,小程序">
    <meta name="description" content="Flutter 1.12后 上传aar至maven私服">
        
    <meta name="author" content="caijinglong">
    <meta property="og:url" content="http://www.kikt.top/posts/flutter/exists/upload-aar-to-maven/">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

    <link rel="stylesheet" href="/css/normalize.css">
    
        <link rel="stylesheet" href="/css/prism.css">
    
    <link rel="stylesheet" href="/css/style.css">
    <script type="text/javascript" src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>

    

   
    <script>
        (function(){
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>

    
    
</head>

<body>
<header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="http://www.kikt.top">
                        caijinglong的博客
                    </a>
                
                <p class="description">Android/Flutter开发者，对于golang/python/ios/java 均有所了解</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="" href="http://www.kikt.top">首页</a>
                    
                    <a  href="http://www.kikt.top/archives/" title="归档">归档</a>
                    
                    <a  href="http://www.kikt.top/contact/" title="接单">接单</a>
                    
                    <a  href="http://www.kikt.top/about/" title="关于">关于</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>


<div id="body">
    <div class="container">
        <div class="col-group">

            <div class="col-8" id="main">
                <div class="res-cons">
                    <article class="post">
                        <header>
                            <h1 class="post-title">Flutter 1.12后 上传aar至maven私服</h1>
                        </header>
                        <date class="post-meta meta-date">
                            2020年2月4日
                        </date>
                        
                        <div class="post-meta meta-category">
                            |
                            
                                <a href="http://www.kikt.top/categories/flutter">flutter</a>
                            
                                <a href="http://www.kikt.top/categories/android">android</a>
                            
                        </div>
                        
                        
                        <div class="post-meta">
                            <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span> 阅读</span></span>
                        </div>
                        
                        <div class="post-content">
                            <h2 id="前言">前言</h2>
<p>本篇写一个将 flutter 打包为 aar 置入已有项目的方案</p>
<p>与<a href="https://www.kikt.top/posts/flutter/exists/android-as-aar-to-maven/">前篇</a>不同的是: 本篇使用新版本的 flutter 环境, 使用 build aar 命令构建 aar,并上传至 maven 私服</p>
<h2 id="开发环境">开发环境</h2>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">$ flutter doctor -v
<span style="color:#f92672">[</span>✓<span style="color:#f92672">]</span> Flutter <span style="color:#f92672">(</span>Channel stable, v1.12.13+hotfix.7, on Mac OS X 10.15 19A602, locale zh-Hans-CN<span style="color:#f92672">)</span>
    • Flutter version 1.12.13+hotfix.7 at /Users/caijinglong/Library/Flutter/flutter_dev
    • Framework revision 9f5ff2306b <span style="color:#f92672">(</span><span style="color:#ae81ff">9</span> 天前<span style="color:#f92672">)</span>, 2020-01-26 22:38:26 -0800
    • Engine revision a67792536c
    • Dart version 2.7.0
</code></pre></div><h2 id="准备步骤">准备步骤</h2>
<h3 id="创建宿主工程">创建宿主工程</h3>
<p>这个是模拟你本来的项目</p>
<p>作为原生开发者自行使用 Android Studio 创建即可</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580819204072_6391.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>一个标准的 android 项目, 除了 gradle 版本使用 6.1.1, 和 maven 仓库使用阿里云镜像, 其他并没有什么修改</p>
<h3 id="创建-flutter-项目">创建 flutter 项目</h3>
<p>这个是模拟你的 flutter 项目</p>
<p>使用 module type</p>
<p><code>$ flutter create -t module flutter_module_example</code></p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580818754120_5855.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>如果你不是这种类型创建的项目, 理论上也可以用 flutter build aar, 但是不保证完全一样</p>
<h3 id="本机启动一个-maven-私服">本机启动一个 maven 私服</h3>
<p>这里使用 docker-compose 启动, 根据你自己的情况来安装, 如果你有公司的 maven 私服或你不喜欢用 docker, 则根据你自己的实际情况跳过这步或使用别的 maven 私服</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580819311253_6335.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#66d9ef">version</span>: <span style="color:#e6db74">&#34;3&#34;</span>

<span style="color:#66d9ef">services</span>:
  <span style="color:#66d9ef">nexus</span>:
    <span style="color:#66d9ef">image</span>: sonatype/nexus3
    <span style="color:#66d9ef">ports</span>:
      - <span style="color:#ae81ff">9000</span>:<span style="color:#ae81ff">8081</span>
    <span style="color:#66d9ef">volumes</span>:
      - /Volumes/Samsung-T5/docker/nexus/data:/nexus-data
</code></pre></div><p>语法是 宿主机:docker 镜像</p>
<p>端口是将 docker 的 8081 映射到本机的 9000 端口</p>
<p>volumes 是映射 nexus 的数据到本机的文件夹内</p>
<p><code>$ docker-compose up</code> 启动 docker</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580819609201_7071.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>我这里不是初次安装, 所以没有, 你如果是初次安装可以从 data 文件夹内找到 <code>admin.password</code> 查看初始密码</p>
<p>一般初次登陆会让你设置一个, 记住它后面要用到</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580819824621_4087.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>这个就是私服的 maven url 地址</p>
<h2 id="flutter-项目">flutter 项目</h2>
<h3 id="修改项目">修改项目</h3>
<p>本篇修改一下 flutter 项目, 引入一个<code>path_provider</code></p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-yml" data-lang="yml"><span style="color:#66d9ef">dependencies</span>:
  <span style="color:#66d9ef">flutter</span>:
    <span style="color:#66d9ef">sdk</span>: flutter

  <span style="color:#75715e"># The following adds the Cupertino Icons font to your application.</span>
  <span style="color:#75715e"># Use with the CupertinoIcons class for iOS style icons.</span>
  <span style="color:#66d9ef">cupertino_icons</span>: ^<span style="color:#ae81ff">0.1.2</span>
  <span style="color:#66d9ef">path_provider</span>: any
</code></pre></div><p>实际开发时别用这个 any 版本号, 我只是懒得看最新版是多少而已</p>
<h3 id="构建-aar">构建 aar</h3>
<p><code>$ flutter build aar</code> 来打包</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580820404462_5557.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>这里 build 完, console 日志有提示你怎么配置你的 host 项目, 如果你是自己开发, 直接用本地的 repo 目录作为仓库就可以了, 将配置复制到项目里即可</p>
<p>repositories 闭包配置可以写在在 host 项目, 也可以配置在 app module 中, 你如果不明白项目和 module 的差别, 可以请教你们安卓原生同事, 也可以自行百度</p>
<p><strong>其他的配置</strong>请配置到 app module 里</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-groovy" data-lang="groovy">
<span style="color:#75715e">// 添加 maven 仓库 url
</span><span style="color:#75715e"></span>repositories <span style="color:#f92672">{</span>
    maven <span style="color:#f92672">{</span>
        url <span style="color:#e6db74">&#39;/Volumes/Samsung-T5/code/flutter/exists_blog/flutter_module_example/build/host/outputs/repo&#39;</span> <span style="color:#75715e">// 这个是我本地的, 你根据你自己的情况肯定不一样, 不要直接复制粘贴我的, 粘贴命令行里的
</span><span style="color:#75715e"></span>    <span style="color:#f92672">}</span>
    maven <span style="color:#f92672">{</span>
        url <span style="color:#e6db74">&#39;http://download.flutter.io&#39;</span> <span style="color:#75715e">// 这个是flutter的maven仓库地址
</span><span style="color:#75715e"></span>    <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>

<span style="color:#75715e">// 添加依赖
</span><span style="color:#75715e"></span>dependencies <span style="color:#f92672">{</span>
    debugImplementation <span style="color:#e6db74">&#39;com.example.flutter_module_example:flutter_debug:1.0&#39;</span>
    profileImplementation <span style="color:#e6db74">&#39;com.example.flutter_module_example:flutter_profile:1.0&#39;</span>
    releaseImplementation <span style="color:#e6db74">&#39;com.example.flutter_module_example:flutter_release:1.0&#39;</span>
<span style="color:#f92672">}</span>

<span style="color:#75715e">// 因为android项目默认是没有profile类型的, 这里需要你自己加一个, 然后配置参考debug
</span><span style="color:#75715e"></span>android <span style="color:#f92672">{</span>
    buildTypes <span style="color:#f92672">{</span>
        profile <span style="color:#f92672">{</span>
            initWith debug
        <span style="color:#f92672">}</span>
    <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>
</code></pre></div><p>当然, 实际上不太可能是自己开发, 即便是自己开发, 也不可能家里和公司连目录结构都一模一样, 然后这里就是 maven 私服的作用了, 让依赖相同, 以便于合作开发</p>
<h3 id="分析下构建产物">分析下构建产物</h3>
<p>这里我们注意到, 我们依赖只有一个 flutter_module_example, 没有 path_provider, 这个就是 maven 帮我们处理的了</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580821001871_7965.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>看目录结构, path_provider 是有的, 还分为 release profile debug</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580821209977_8854.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>这里是 flutter 项目对应的 pom 文件, 依赖了三部分代码, 这样 maven 就会自动帮你把这三部分代码都下载并依赖</p>
<h3 id="上传依赖">上传依赖</h3>
<h4 id="使用界面上传">使用界面上传</h4>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580821656841_8110.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580821736093_7394.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>这里分别上传就看见了</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580821828290_7285.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>因为是演示, 我只上传 release 的, 然后在 host 项目里引用</p>
<p>项目里, 根目录的<code>build.gradle</code></p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-groovy" data-lang="groovy">repositories<span style="color:#f92672">{</span>
    maven<span style="color:#f92672">{</span>
        url <span style="color:#e6db74">&#39;http://localhost:9000/repository/maven-releases/&#39;</span> <span style="color:#75715e">// 你自己的maven私服地址
</span><span style="color:#75715e"></span>    <span style="color:#f92672">}</span>
    maven<span style="color:#f92672">{</span>
        url <span style="color:#e6db74">&#39;http://download.flutter.io&#39;</span>
    <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>
</code></pre></div><p>app 的<code>build.gradle</code></p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-groovy" data-lang="groovy">dependencies<span style="color:#f92672">{</span>
    implementation <span style="color:#e6db74">&#39;com.example.flutter_module_example:flutter_release:1.0&#39;</span>
<span style="color:#f92672">}</span>
</code></pre></div><p>这样就可以了</p>
<p>当然肯定还有问题, 但是基本的思路已经通了, 接着就是怎么自动化的问题了</p>
<h2 id="自动化的探索">自动化的探索</h2>
<h3 id="命令行上传">命令行上传</h3>
<p>自动化的话, 肯定需要有工具或者命令行上传</p>
<p>我这里选择的是命令行的方案</p>
<p>但在这之前, 我需要先把旧的包删除掉, 以便于保证我命令行的包可以上传成功</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580830157069_1008.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>在 browser 视图中统统删掉</p>
<p>接着进入刚刚的 repo 文件夹</p>
<p><code>$ cd flutter_module_example/build/host/outputs/repo/com/example/flutter_module_example/flutter_release/1.0</code></p>
<p>根据<a href="https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html">maven 官网说明</a>
可以使用 <code>mvn deploy:deploy-file</code> 命令来上传</p>
<p><code>$ mvn deploy:deploy-file -DpomFile=flutter_release-1.0.pom -Dfile=flutter_release-1.0.aar -Durl=http://localhost:9000/repository/maven-releases/</code></p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580830817585_8006.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>这里我得到了一个错误, 错误原因呢是认证失败, 也就是说没权限, 这是肯定的, 因为一个 maven 私服你能看就不错了, 没权限还想上传怕是想太多, 万一你给人挂个马怎么办?</p>
<p>所以我们需要配置权限</p>
<p>眼尖的同学可能发现了, 有一个 <a href="https://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException">Help 1</a> 标签告诉我们如何配置权限</p>
<p>点开一看, 有 3 种方式:</p>
<ol>
<li>配置 http 代理, 然后在代理里帮我们加上 basic 的请求头(这里就引申出一个, 可以用反代的方式, 你请求自己的某个 nginx/caddy, 然后由 nginx 帮你加 http 的 authentication 请求头, 但是这样做太复杂没必要)</li>
<li>settings.xml 中针对仓库配置密码或私钥选项</li>
<li>配置 ssl 来连接</li>
</ol>
<p>这里 ssl 比较复杂, 不适合 demo 演示, 如果你们公司有要求则根据你们公司的来</p>
<p>我这里选用 settings.xml 来做, 并且为了演示方便, 我将 settings 放在项目文件夹下, 然后用<code>mvn -s</code> 参数引用配置文件, 这样的好处是对于系统的 mvn 配置没有侵入性, 当然你也可以按照官方的说法修改 m2 文件夹下的配置文件,这个请自行搜索如何做</p>
<p>我的 maven 是 brew 安装的, 可以通过<code>brew info maven</code>来查看</p>
<p>然后进入到<code>&lt;maven&gt;/libexec/conf</code>文件夹下, 复制 settings.xml 出来</p>
<p>然后找到 servers 标签修改如下:</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-xml" data-lang="xml"><span style="color:#f92672">&lt;servers&gt;</span>
    <span style="color:#f92672">&lt;server&gt;</span>
      <span style="color:#f92672">&lt;id&gt;</span>nexus<span style="color:#f92672">&lt;/id&gt;</span>
      <span style="color:#f92672">&lt;username&gt;</span>admin<span style="color:#f92672">&lt;/username&gt;</span>
      <span style="color:#f92672">&lt;password&gt;</span>admin<span style="color:#f92672">&lt;/password&gt;</span>
    <span style="color:#f92672">&lt;/server&gt;</span>
<span style="color:#f92672">&lt;servers&gt;</span>
</code></pre></div><p>用户名,密码换成你的</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-bash" data-lang="bash">mvn deploy:deploy-file <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-DpomFile<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;build/host/outputs/repo/com/example/flutter_module_example/flutter_release/1.0/flutter_release-1.0.pom&#34;</span> <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-DgeneratePom<span style="color:#f92672">=</span>false <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-Dfile<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;build/host/outputs/repo/com/example/flutter_module_example/flutter_release/1.0/flutter_release-1.0.aar&#34;</span> <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-Durl<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;http://localhost:9000/repository/maven-releases&#34;</span> <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-DrepositoryId<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;nexus&#34;</span> <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-Dpackaging<span style="color:#f92672">=</span>aar <span style="color:#ae81ff">\
</span><span style="color:#ae81ff"></span>-s<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;mvn-settings.xml&#34;</span>
</code></pre></div><p>这样就可以提交成功了</p>
<p>但是这样会发现一个问题, flutter 打包出来的版本号永远是 1.0, 而 flutter 在稍后的版本提供了参数可以在 build aar 的时候修改版本号, 而对于目前应用广泛的 stable 版(1.12.13+hotfix.7)来说, 并没有这个功能</p>
<p>所以, 我们需要在上传前修改 pom 文件, 将版本号根据某个规律提升或指定, 而这个是可以自动化完成的事情, 因为 pom 实质上就是 xml 文件, 而 xml 的解析对于大部分语言来说都是有三方库可以完成的</p>
<h3 id="整理思路">整理思路</h3>
<p>自动化部署需要完成如下的步骤</p>
<ol>
<li>flutter build aar</li>
<li>找到所有的 aar 文件对应的 pom 文件, 使用 xml 解析并将版本号修改, 同时修改依赖对应的版本号</li>
<li>上传 aar 和 pom</li>
<li>修改 android 端的依赖到最新的 flutter 版本号</li>
</ol>
<h3 id="编写脚本">编写脚本</h3>
<p>思路有了, 我们编写工具完成这个步骤就可以了, 这里我使用 dart 来完成, 因为 dart 是 flutter 的开发语言, 对于 flutter 开发来说上手难度较低, 当然也可以用 python/go 等任何你熟悉的语言来完成</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-dart" data-lang="dart"><span style="color:#66d9ef">import</span> <span style="color:#e6db74">&#39;dart:convert&#39;</span>;
<span style="color:#66d9ef">import</span> <span style="color:#e6db74">&#39;dart:io&#39;</span>;
<span style="color:#66d9ef">import</span> <span style="color:#e6db74">&#39;package:xml/xml.dart&#39;</span> <span style="color:#66d9ef">as</span> xml;

<span style="color:#66d9ef">const</span> targetVersion <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;1.0.4&#34;</span>;

<span style="color:#66d9ef">class</span> <span style="color:#a6e22e">DeployObject</span> {
  File pomFile;
  File aarFile;
}

<span style="color:#66d9ef">void</span> main() {
  List<span style="color:#f92672">&lt;</span>File<span style="color:#f92672">&gt;</span> aarFiles <span style="color:#f92672">=</span> [];
  List<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">String</span><span style="color:#f92672">&gt;</span> needChangeList <span style="color:#f92672">=</span> [];
  List<span style="color:#f92672">&lt;</span>DeployObject<span style="color:#f92672">&gt;</span> deploys <span style="color:#f92672">=</span> [];

  <span style="color:#66d9ef">final</span> dir <span style="color:#f92672">=</span> Directory(<span style="color:#e6db74">&#34;build/host/outputs/repo&#34;</span>);

  <span style="color:#75715e">// 扫描aar
</span><span style="color:#75715e"></span>  <span style="color:#66d9ef">for</span> (<span style="color:#66d9ef">final</span> file <span style="color:#66d9ef">in</span> dir.listSync(recursive: <span style="color:#66d9ef">true</span>)) {
    <span style="color:#66d9ef">if</span> (file.path.endsWith(<span style="color:#e6db74">&#34;.aar&#34;</span>)) {
      aarFiles.add(file); <span style="color:#75715e">// aar文件
</span><span style="color:#75715e"></span>      needChangeList.add(
        file.uri.pathSegments[file.uri.pathSegments.length <span style="color:#f92672">-</span> <span style="color:#ae81ff">3</span>],
      ); <span style="color:#75715e">// 库的名称, 为了简单, 我只扫描了项目名称, 没有扫描组名, 如果你不幸有重名, 需要自己增加对于包名的处理
</span><span style="color:#75715e"></span>    }
  }

  <span style="color:#66d9ef">for</span> (<span style="color:#66d9ef">final</span> aar <span style="color:#66d9ef">in</span> aarFiles) {
    <span style="color:#66d9ef">final</span> pomFile <span style="color:#f92672">=</span> handlePom(needChangeList, aar); <span style="color:#75715e">// 处理pom文件
</span><span style="color:#75715e"></span>    deploys.add(DeployObject()
      ..aarFile <span style="color:#f92672">=</span> aar
      ..pomFile <span style="color:#f92672">=</span> pomFile);
  }

  <span style="color:#66d9ef">for</span> (<span style="color:#66d9ef">final</span> deploy <span style="color:#66d9ef">in</span> deploys) {
    deployPkt(deploy);
  }
}

File handlePom(List<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">String</span><span style="color:#f92672">&gt;</span> needChangeVersionList, File aarFile) {
  <span style="color:#66d9ef">final</span> pomPath <span style="color:#f92672">=</span> aarFile.path.substring(<span style="color:#ae81ff">0</span>, aarFile.path.length <span style="color:#f92672">-</span> <span style="color:#ae81ff">3</span>) <span style="color:#f92672">+</span> <span style="color:#e6db74">&#39;pom&#39;</span>;

  <span style="color:#66d9ef">final</span> file <span style="color:#f92672">=</span> File(pomPath);

  <span style="color:#66d9ef">final</span> doc <span style="color:#f92672">=</span> xml.parse(file.readAsStringSync());

  {
    <span style="color:#75715e">// 修改自身的版本号
</span><span style="color:#75715e"></span>    <span style="color:#66d9ef">final</span> xml.XmlText versionNode <span style="color:#f92672">=</span>
        doc.findAllElements(<span style="color:#e6db74">&#34;version&#34;</span>).first.firstChild;
    versionNode.text <span style="color:#f92672">=</span> targetVersion;

    <span style="color:#75715e">// 这里添加大括号只是为了看的清楚, 实际可不加
</span><span style="color:#75715e"></span>  }

  <span style="color:#66d9ef">final</span> elements <span style="color:#f92672">=</span> doc.findAllElements(<span style="color:#e6db74">&#34;dependency&#34;</span>);
  <span style="color:#66d9ef">for</span> (<span style="color:#66d9ef">final</span> element <span style="color:#66d9ef">in</span> elements) {
    <span style="color:#66d9ef">final</span> artifactId <span style="color:#f92672">=</span> element.findElements(<span style="color:#e6db74">&#34;artifactId&#34;</span>).first.text;
    <span style="color:#66d9ef">if</span> (needChangeVersionList.contains(artifactId)) {
      <span style="color:#66d9ef">final</span> xml.XmlText versionNode <span style="color:#f92672">=</span>
          element.findElements(<span style="color:#e6db74">&#34;version&#34;</span>).first.firstChild;
      versionNode.text <span style="color:#f92672">=</span> targetVersion; <span style="color:#75715e">// 修改依赖的版本号
</span><span style="color:#75715e"></span>    }
  }

  <span style="color:#66d9ef">final</span> buffer <span style="color:#f92672">=</span> StringBuffer();

  doc.writePrettyTo(buffer, <span style="color:#ae81ff">0</span>, <span style="color:#e6db74">&#34;  &#34;</span>);
  print(buffer);

  <span style="color:#66d9ef">return</span> file..writeAsStringSync(buffer.toString());
}

Future<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">void</span><span style="color:#f92672">&gt;</span> deployPkt(DeployObject deploy) <span style="color:#66d9ef">async</span> {
  <span style="color:#66d9ef">final</span> configPath <span style="color:#f92672">=</span> File(<span style="color:#e6db74">&#39;mvn-settings.xml&#39;</span>).absolute.path;
  List<span style="color:#f92672">&lt;</span><span style="color:#66d9ef">String</span><span style="color:#f92672">&gt;</span> args <span style="color:#f92672">=</span> [
    <span style="color:#e6db74">&#39;deploy:deploy-file&#39;</span>,
    <span style="color:#e6db74">&#39;-DpomFile=&#34;</span><span style="color:#e6db74">${</span>deploy.pomFile.absolute.path<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;&#39;</span>,
    <span style="color:#e6db74">&#39;-DgeneratePom=false&#39;</span>,
    <span style="color:#e6db74">&#39;-Dfile=&#34;</span><span style="color:#e6db74">${</span>deploy.aarFile.absolute.path<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;&#39;</span>,
    <span style="color:#e6db74">&#39;-Durl=&#34;http://localhost:9000/repository/maven-releases&#34;&#39;</span>,
    <span style="color:#e6db74">&#39;-DrepositoryId=&#34;nexus&#34;&#39;</span>,
    <span style="color:#e6db74">&#39;-Dpackaging=aar&#39;</span>,
    <span style="color:#e6db74">&#39;-s=&#34;</span><span style="color:#e6db74">$</span>configPath<span style="color:#e6db74">&#34;&#39;</span>,
  ];
  <span style="color:#66d9ef">final</span> shell <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;mvn </span><span style="color:#e6db74">${</span>args.join(<span style="color:#e6db74">&#39; </span><span style="color:#ae81ff">\\\n</span><span style="color:#e6db74">    &#39;</span>)<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>;
  <span style="color:#66d9ef">final</span> f <span style="color:#f92672">=</span> File(
      <span style="color:#e6db74">&#34;</span><span style="color:#e6db74">${</span>Directory.systemTemp.path<span style="color:#e6db74">}</span><span style="color:#e6db74">/</span><span style="color:#e6db74">${</span>DateTime.now().millisecondsSinceEpoch<span style="color:#e6db74">}</span><span style="color:#e6db74">.sh&#34;</span>);
  f.writeAsStringSync(shell);
  <span style="color:#66d9ef">final</span> process <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> Process.start(<span style="color:#e6db74">&#39;bash&#39;</span>, [f.path]);
  <span style="color:#66d9ef">final</span> output <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> utf8.decodeStream(process.stdout);
  print(output);
  <span style="color:#66d9ef">final</span> exitCode <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> process.exitCode;
  <span style="color:#66d9ef">if</span> (exitCode <span style="color:#f92672">!=</span> <span style="color:#ae81ff">0</span>) {
    exit(exitCode);
  }
}
</code></pre></div><p>完整版的脚本在这里
只保证有 bash 环境可用, 因为是用 bash 来执行的, window 可能需要根据你的环境有所修改</p>
<p>然后, 每次都会创建 n 个临时的 sh 文件用于上传</p>
<p>我这里执行一下: <code>$ dart bin/main.dart</code></p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580873688813_6395.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>能看到一堆的执行成功</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580873894183_7572.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>然后我们查看 nexus 的 web 端, 我们能看到 1.0.4 在 maven 私服上已经有了</p>
<p>点右边的 pom 文件的连接看看内容</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580873989055_2189.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>自身是 1.0.4 版本, 依赖的 path_provider 也是, 但 io.flutter 的引擎体系还是应该的版本号</p>
<h2 id="宿主项目的修改">宿主项目的修改</h2>
<p>接着就是修改宿主项目的依赖了, 我们最早的时候用的是 1.0 版本</p>
<p>我们添加依赖</p>
<p><code>implementation 'com.example.flutter_module_example:flutter_release:1.0.4'</code></p>
<p>然后 gradle sync, 等待一会儿就能同步成功了</p>
<p>这样以后我们 flutter 开发人员就可以直接对安卓组说, 我更新了一个开发版, 1.0.5-dev1, 你试试能不能跑, 交互有没有问题之类的</p>
<h3 id="修改代码打开-flutter-的页面">修改代码打开 flutter 的页面</h3>
<p>这里就是修改 MainActivity 了</p>
<p>修改布局文件: activity_main.xml</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580874531007_8794.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>修改下右边的 text 属性</p>
<p>修改 java 文件</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#f92672">package</span> top.kikt.flutterhost<span style="color:#f92672">;</span>

<span style="color:#f92672">import</span> androidx.appcompat.app.AppCompatActivity<span style="color:#f92672">;</span>

<span style="color:#f92672">import</span> android.content.Intent<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.os.Bundle<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.os.Handler<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.os.Looper<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.view.View<span style="color:#f92672">;</span>

<span style="color:#f92672">import</span> io.flutter.app.FlutterActivity<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> io.flutter.embedding.engine.FlutterEngine<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> io.flutter.view.FlutterMain<span style="color:#f92672">;</span>

<span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">MainActivity</span> <span style="color:#66d9ef">extends</span> AppCompatActivity <span style="color:#f92672">{</span>

  <span style="color:#a6e22e">@Override</span>
  <span style="color:#66d9ef">protected</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">onCreate</span><span style="color:#f92672">(</span>Bundle savedInstanceState<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
    <span style="color:#66d9ef">super</span><span style="color:#f92672">.</span><span style="color:#a6e22e">onCreate</span><span style="color:#f92672">(</span>savedInstanceState<span style="color:#f92672">);</span>
    setContentView<span style="color:#f92672">(</span>R<span style="color:#f92672">.</span><span style="color:#a6e22e">layout</span><span style="color:#f92672">.</span><span style="color:#a6e22e">activity_main</span><span style="color:#f92672">);</span>

    <span style="color:#75715e">// 添加下面那段
</span><span style="color:#75715e"></span>    findViewById<span style="color:#f92672">(</span>R<span style="color:#f92672">.</span><span style="color:#a6e22e">id</span><span style="color:#f92672">.</span><span style="color:#a6e22e">bt_to_flutter</span><span style="color:#f92672">).</span><span style="color:#a6e22e">setOnClickListener</span><span style="color:#f92672">(</span><span style="color:#66d9ef">new</span> View<span style="color:#f92672">.</span><span style="color:#a6e22e">OnClickListener</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
      <span style="color:#a6e22e">@Override</span>
      <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">onClick</span><span style="color:#f92672">(</span>View v<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
        FlutterMain<span style="color:#f92672">.</span><span style="color:#a6e22e">startInitialization</span><span style="color:#f92672">(</span>getApplicationContext<span style="color:#f92672">());</span>
        FlutterMain<span style="color:#f92672">.</span><span style="color:#a6e22e">ensureInitializationComplete</span><span style="color:#f92672">(</span>getApplicationContext<span style="color:#f92672">(),</span> <span style="color:#66d9ef">null</span><span style="color:#f92672">);</span>
        Intent intent <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> Intent<span style="color:#f92672">(</span>MainActivity<span style="color:#f92672">.</span><span style="color:#a6e22e">this</span><span style="color:#f92672">,</span> FlutterActivity<span style="color:#f92672">.</span><span style="color:#a6e22e">class</span><span style="color:#f92672">);</span>
        startActivity<span style="color:#f92672">(</span>intent<span style="color:#f92672">);</span>
      <span style="color:#f92672">}</span>
    <span style="color:#f92672">});</span>
  <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>

</code></pre></div><p>开启新页面的代码, 一点, 嗯.. crash 了</p>
<p>没事, 我们查查日志</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580874871139_7563.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>哦, 原来是没添加 Activity 到 manifest 里, 好久没写安卓都忘了</p>
<p>打开<code>AndroidManifest.xml</code></p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-xml" data-lang="xml"><span style="color:#f92672">&lt;application&gt;</span>
 <span style="color:#f92672">&lt;activity</span> <span style="color:#a6e22e">android:name=</span><span style="color:#e6db74">&#34;io.flutter.app.FlutterActivity&#34;</span> <span style="color:#f92672">/&gt;</span>
<span style="color:#f92672">&lt;/application&gt;</span>
</code></pre></div><p>然后运行就可以跑起来了, 点下 Open flutter 按钮</p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580875476287_5768.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p><img src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/df66928f-89ec-4688-abf0-d9acdc6cc858/items?path=%2F1580875492296_1491.png&amp;versionDescriptor%5BversionOptions%5D=0&amp;versionDescriptor%5BversionType%5D=0&amp;versionDescriptor%5Bversion%5D=master&amp;resolveLfs=true&amp;%24format=octetStream&amp;api-version=5.0" alt="image"></p>
<p>开启 flutter 页面的时候会黑屏一下, 这是因为这里需要加载 flutter 引擎, 提前加载引擎可以减少这种情况, 但无法根治, 请自行百度搜索解决方案</p>
<p>这里是提前初始化的代码</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-java" data-lang="java"><span style="color:#f92672">package</span> top.kikt.flutterhost<span style="color:#f92672">;</span>

<span style="color:#f92672">import</span> androidx.appcompat.app.AppCompatActivity<span style="color:#f92672">;</span>

<span style="color:#f92672">import</span> android.content.Intent<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.os.Bundle<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.os.Handler<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.os.Looper<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> android.view.View<span style="color:#f92672">;</span>

<span style="color:#f92672">import</span> io.flutter.app.FlutterActivity<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> io.flutter.embedding.engine.FlutterEngine<span style="color:#f92672">;</span>
<span style="color:#f92672">import</span> io.flutter.view.FlutterMain<span style="color:#f92672">;</span>

<span style="color:#66d9ef">public</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">MainActivity</span> <span style="color:#66d9ef">extends</span> AppCompatActivity <span style="color:#f92672">{</span>

  <span style="color:#66d9ef">boolean</span> flutterInited <span style="color:#f92672">=</span> <span style="color:#66d9ef">false</span><span style="color:#f92672">;</span>

  <span style="color:#a6e22e">@Override</span>
  <span style="color:#66d9ef">protected</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">onCreate</span><span style="color:#f92672">(</span>Bundle savedInstanceState<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
    <span style="color:#66d9ef">super</span><span style="color:#f92672">.</span><span style="color:#a6e22e">onCreate</span><span style="color:#f92672">(</span>savedInstanceState<span style="color:#f92672">);</span>
    setContentView<span style="color:#f92672">(</span>R<span style="color:#f92672">.</span><span style="color:#a6e22e">layout</span><span style="color:#f92672">.</span><span style="color:#a6e22e">activity_main</span><span style="color:#f92672">);</span>

    findViewById<span style="color:#f92672">(</span>R<span style="color:#f92672">.</span><span style="color:#a6e22e">id</span><span style="color:#f92672">.</span><span style="color:#a6e22e">bt_to_flutter</span><span style="color:#f92672">).</span><span style="color:#a6e22e">setOnClickListener</span><span style="color:#f92672">(</span><span style="color:#66d9ef">new</span> View<span style="color:#f92672">.</span><span style="color:#a6e22e">OnClickListener</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
      <span style="color:#a6e22e">@Override</span>
      <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">onClick</span><span style="color:#f92672">(</span>View v<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
        <span style="color:#66d9ef">if</span> <span style="color:#f92672">(!</span>flutterInited<span style="color:#f92672">)</span> <span style="color:#f92672">{</span>
          FlutterMain<span style="color:#f92672">.</span><span style="color:#a6e22e">startInitialization</span><span style="color:#f92672">(</span>getApplicationContext<span style="color:#f92672">());</span>
          FlutterMain<span style="color:#f92672">.</span><span style="color:#a6e22e">ensureInitializationComplete</span><span style="color:#f92672">(</span>getApplicationContext<span style="color:#f92672">(),</span> <span style="color:#66d9ef">null</span><span style="color:#f92672">);</span>
        <span style="color:#f92672">}</span>
        Intent intent <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> Intent<span style="color:#f92672">(</span>MainActivity<span style="color:#f92672">.</span><span style="color:#a6e22e">this</span><span style="color:#f92672">,</span> FlutterActivity<span style="color:#f92672">.</span><span style="color:#a6e22e">class</span><span style="color:#f92672">);</span>
        startActivity<span style="color:#f92672">(</span>intent<span style="color:#f92672">);</span>
      <span style="color:#f92672">}</span>
    <span style="color:#f92672">});</span>

    initFlutterEngine<span style="color:#f92672">();</span>
  <span style="color:#f92672">}</span>

  <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">initFlutterEngine</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
    FlutterMain<span style="color:#f92672">.</span><span style="color:#a6e22e">startInitialization</span><span style="color:#f92672">(</span>getApplicationContext<span style="color:#f92672">());</span>
    FlutterMain<span style="color:#f92672">.</span><span style="color:#a6e22e">ensureInitializationCompleteAsync</span><span style="color:#f92672">(</span>getApplicationContext<span style="color:#f92672">(),</span> <span style="color:#66d9ef">null</span><span style="color:#f92672">,</span> <span style="color:#66d9ef">new</span> Handler<span style="color:#f92672">(),</span> <span style="color:#66d9ef">new</span> Runnable<span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
      <span style="color:#a6e22e">@Override</span>
      <span style="color:#66d9ef">public</span> <span style="color:#66d9ef">void</span> <span style="color:#a6e22e">run</span><span style="color:#f92672">()</span> <span style="color:#f92672">{</span>
        flutterInited <span style="color:#f92672">=</span> <span style="color:#66d9ef">true</span><span style="color:#f92672">;</span>
      <span style="color:#f92672">}</span>
    <span style="color:#f92672">});</span>
  <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>

</code></pre></div><p>这里如果有用模拟器的朋友可能会遇到没找到 so 的 crash, 这是因为 x86 引擎没有 release 的 so 的原因, 而我们是单独引用 release 的原因</p>
<p>我们按照官方的方案添加如下配置在 app 的 build.gradle 里</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-groovy" data-lang="groovy">android<span style="color:#f92672">{</span>
    buildTypes <span style="color:#f92672">{</span>
        profile <span style="color:#f92672">{</span>
            initWith debug
        <span style="color:#f92672">}</span>
    <span style="color:#f92672">}</span>
<span style="color:#f92672">}</span>

dependencies<span style="color:#f92672">{</span>
    <span style="color:#66d9ef">def</span> flutterModuleVersion <span style="color:#f92672">=</span> <span style="color:#e6db74">&#39;1.0.4&#39;</span>
    debugImplementation <span style="color:#e6db74">&#34;com.example.flutter_module_example:flutter_debug:$flutterModuleVersion&#34;</span>
    profileImplementation <span style="color:#e6db74">&#34;com.example.flutter_module_example:flutter_profile:$flutterModuleVersion&#34;</span>
    releaseImplementation <span style="color:#e6db74">&#34;com.example.flutter_module_example:flutter_release:$flutterModuleVersion&#34;</span>
<span style="color:#f92672">}</span>
</code></pre></div><p>这样就可以了</p>
<h2 id="后记">后记</h2>
<p>本篇完成了打包 aar 并上传 maven 的全过程</p>
<p><a href="https://github.com/CaiJingLong/upload_flutter_aar_to_maven">仓库地址</a></p>
<p>有问题请在<a href="http://kikt.top/posts/flutter/exists/upload-aar-to-maven/">博客</a>下留言, 其他地方的留言不保证能看到</p>
<p>以上</p>

                        </div>

                        

<div class="post-archive">
    <h2>See Also</h2>
    <ul class="listing">
        
        <li><a href="/posts/flutter/exists/android-as-aar-to-maven/">把flutter项目作为aar添加到已有的Android工程上</a></li>
        
        <li><a href="/posts/flutter/dart/generators/">dart中的生成器函数</a></li>
        
        <li><a href="/posts/flutter/ffi/2-first-party/">在 flutter 上使用 c 代码 - (二) 无源码的项目</a></li>
        
        <li><a href="/posts/flutter/ffi/1-first-party/">在 flutter 上使用 c 代码 - (一) 有源码的项目</a></li>
        
        <li><a href="/posts/dart/file/read/">dart 大文件读取</a></li>
        
    </ul>
</div>


                        <div class="post-meta meta-tags">
                            
                            <ul class="clearfix">
                                
                                <li><a href="http://www.kikt.top/tags/flutter">flutter</a></li>
                                
                                <li><a href="http://www.kikt.top/tags/maven">maven</a></li>
                                
                                <li><a href="http://www.kikt.top/tags/aar">aar</a></li>
                                
                            </ul>
                            
                        </div>
                    </article>
                    
    

    
    
    <div class="post bg-white">
      <script src="https://utteranc.es/client.js"
            repo= "caijinglong/kikt-blog-comment"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
      </script>
    </div>
    
                </div>
            </div>
            <div id="secondary">
    <section class="widget">
        <form id="search" action="//www.google.com/search" method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="http://www.kikt.top">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>
    
    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="http://www.kikt.top/posts/java/crack/crack1/" title="使用javassist,修改jar包方法实现">使用javassist,修改jar包方法实现</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/github/actions/create/" title="Github action 的开发到发布">Github action 的开发到发布</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/flutter/jenkins&#43;fastlane/" title="flutter Jenkins&#43;fastlane 自动化打测试包, 并上传蒲公英">flutter Jenkins&#43;fastlane 自动化打测试包, 并上传蒲公英</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/go/compile-for-android/" title="编译 go 源码为 android 动态库(so)">编译 go 源码为 android 动态库(so)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/flutter/focusnode-2/" title="Flutter FocusNode 焦点那点事-(二)">Flutter FocusNode 焦点那点事-(二)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/flutter/focusnode-1/" title="Flutter FocusNode 焦点那点事-(一)">Flutter FocusNode 焦点那点事-(一)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/server/caddy/cros_for_local_dev/" title="用 Caddy 解决 web 开发中本地跨域的问题">用 Caddy 解决 web 开发中本地跨域的问题</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/flutter/route/navigator-helper2/" title="Navigator Helper2">Navigator Helper2</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/flutter/grey-app/" title="flutter 怎么实现app整体灰度">flutter 怎么实现app整体灰度</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/posts/flutter/plugin/flutter-sdk-import-aar/" title="Flutter 插件开发之引入aar到安卓部分 并使用本地maven">Flutter 插件开发之引入aar到安卓部分 并使用本地maven</a>
    </li>
    
</ul>
    </section>

    

    <section class="widget">
        <h3 class="widget-title">分类</h3>
<ul class="widget-list">
    
    <li>
        <a href="http://www.kikt.top/categories/android/">android(25)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/caddy/">caddy(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/dart/">dart(5)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/docker/">docker(3)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/flutter/">flutter(60)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/github/">github(3)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/go/">go(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/golang/">golang(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/iOS/">iOS(6)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/ios/">ios(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/java/">java(6)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/jetbrains/">jetbrains(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/other/">other(3)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/python/">python(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/server/">server(5)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/spring/">spring(3)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/tools/">tools(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/%E6%9D%82%E9%A1%B9/">杂项(1)</a>
    </li>
    
    <li>
        <a href="http://www.kikt.top/categories/%E6%B6%82%E9%B8%A6/">涂鸦(1)</a>
    </li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title">标签</h3>
<div class="tagcloud">
    
    <a href="http://www.kikt.top/tags/10/">10</a>
    
    <a href="http://www.kikt.top/tags/2.3/">2.3</a>
    
    <a href="http://www.kikt.top/tags/Clipboard/">Clipboard</a>
    
    <a href="http://www.kikt.top/tags/Javassist/">Javassist</a>
    
    <a href="http://www.kikt.top/tags/Migrate/">Migrate</a>
    
    <a href="http://www.kikt.top/tags/aar/">aar</a>
    
    <a href="http://www.kikt.top/tags/actions/">actions</a>
    
    <a href="http://www.kikt.top/tags/aidl/">aidl</a>
    
    <a href="http://www.kikt.top/tags/android/">android</a>
    
    <a href="http://www.kikt.top/tags/androidQ/">androidQ</a>
    
    <a href="http://www.kikt.top/tags/androidX/">androidX</a>
    
    <a href="http://www.kikt.top/tags/apk/">apk</a>
    
    <a href="http://www.kikt.top/tags/app/">app</a>
    
    <a href="http://www.kikt.top/tags/appcode/">appcode</a>
    
    <a href="http://www.kikt.top/tags/azure/">azure</a>
    
    <a href="http://www.kikt.top/tags/ble/">ble</a>
    
    <a href="http://www.kikt.top/tags/bottomsheet/">bottomsheet</a>
    
    <a href="http://www.kikt.top/tags/butterknife/">butterknife</a>
    
    <a href="http://www.kikt.top/tags/c/">c</a>
    
    <a href="http://www.kikt.top/tags/caddy/">caddy</a>
    
    <a href="http://www.kikt.top/tags/camera/">camera</a>
    
    <a href="http://www.kikt.top/tags/cameraX/">cameraX</a>
    
    <a href="http://www.kikt.top/tags/channel/">channel</a>
    
    <a href="http://www.kikt.top/tags/cocoapods/">cocoapods</a>
    
    <a href="http://www.kikt.top/tags/cupertino/">cupertino</a>
    
    <a href="http://www.kikt.top/tags/dart/">dart</a>
    
    <a href="http://www.kikt.top/tags/dart-2.6/">dart-2.6</a>
    
    <a href="http://www.kikt.top/tags/desktop/">desktop</a>
    
    <a href="http://www.kikt.top/tags/dialog/">dialog</a>
    
    <a href="http://www.kikt.top/tags/dmg/">dmg</a>
    
    <a href="http://www.kikt.top/tags/doc/">doc</a>
    
    <a href="http://www.kikt.top/tags/docker/">docker</a>
    
    <a href="http://www.kikt.top/tags/docker-compose/">docker-compose</a>
    
    <a href="http://www.kikt.top/tags/excel/">excel</a>
    
    <a href="http://www.kikt.top/tags/exists/">exists</a>
    
    <a href="http://www.kikt.top/tags/faq/">faq</a>
    
    <a href="http://www.kikt.top/tags/fastlane/">fastlane</a>
    
    <a href="http://www.kikt.top/tags/ffi/">ffi</a>
    
    <a href="http://www.kikt.top/tags/ffmpeg/">ffmpeg</a>
    
    <a href="http://www.kikt.top/tags/flexmark/">flexmark</a>
    
    <a href="http://www.kikt.top/tags/flutter/">flutter</a>
    
    <a href="http://www.kikt.top/tags/flutter-web/">flutter-web</a>
    
    <a href="http://www.kikt.top/tags/focus/">focus</a>
    
    <a href="http://www.kikt.top/tags/focusNode/">focusNode</a>
    
    <a href="http://www.kikt.top/tags/form/">form</a>
    
    <a href="http://www.kikt.top/tags/framework/">framework</a>
    
    <a href="http://www.kikt.top/tags/github/">github</a>
    
    <a href="http://www.kikt.top/tags/go/">go</a>
    
    <a href="http://www.kikt.top/tags/golang/">golang</a>
    
    <a href="http://www.kikt.top/tags/gradle/">gradle</a>
    
    <a href="http://www.kikt.top/tags/http/">http</a>
    
    <a href="http://www.kikt.top/tags/iOS/">iOS</a>
    
    <a href="http://www.kikt.top/tags/ide/">ide</a>
    
    <a href="http://www.kikt.top/tags/idea/">idea</a>
    
    <a href="http://www.kikt.top/tags/index/">index</a>
    
    <a href="http://www.kikt.top/tags/inside/">inside</a>
    
    <a href="http://www.kikt.top/tags/ios/">ios</a>
    
    <a href="http://www.kikt.top/tags/java/">java</a>
    
    <a href="http://www.kikt.top/tags/jenkins/">jenkins</a>
    
    <a href="http://www.kikt.top/tags/jetbrains/">jetbrains</a>
    
    <a href="http://www.kikt.top/tags/jsdelivr/">jsdelivr</a>
    
    <a href="http://www.kikt.top/tags/json/">json</a>
    
    <a href="http://www.kikt.top/tags/json_serializable/">json_serializable</a>
    
    <a href="http://www.kikt.top/tags/junit/">junit</a>
    
    <a href="http://www.kikt.top/tags/library/">library</a>
    
    <a href="http://www.kikt.top/tags/live-template/">live-template</a>
    
    <a href="http://www.kikt.top/tags/loadmore/">loadmore</a>
    
    <a href="http://www.kikt.top/tags/log/">log</a>
    
    <a href="http://www.kikt.top/tags/mac/">mac</a>
    
    <a href="http://www.kikt.top/tags/macos/">macos</a>
    
    <a href="http://www.kikt.top/tags/maven/">maven</a>
    
    <a href="http://www.kikt.top/tags/mysql/">mysql</a>
    
    <a href="http://www.kikt.top/tags/navigationbar/">navigationbar</a>
    
    <a href="http://www.kikt.top/tags/navigator/">navigator</a>
    
    <a href="http://www.kikt.top/tags/ndk/">ndk</a>
    
    <a href="http://www.kikt.top/tags/nginx/">nginx</a>
    
    <a href="http://www.kikt.top/tags/oc/">oc</a>
    
    <a href="http://www.kikt.top/tags/opencv/">opencv</a>
    
    <a href="http://www.kikt.top/tags/poi/">poi</a>
    
    <a href="http://www.kikt.top/tags/pub/">pub</a>
    
    <a href="http://www.kikt.top/tags/python/">python</a>
    
    <a href="http://www.kikt.top/tags/retrofit/">retrofit</a>
    
    <a href="http://www.kikt.top/tags/route/">route</a>
    
    <a href="http://www.kikt.top/tags/server/">server</a>
    
    <a href="http://www.kikt.top/tags/so/">so</a>
    
    <a href="http://www.kikt.top/tags/spp/">spp</a>
    
    <a href="http://www.kikt.top/tags/sprintboot/">sprintboot</a>
    
    <a href="http://www.kikt.top/tags/swift/">swift</a>
    
    <a href="http://www.kikt.top/tags/tap/">tap</a>
    
    <a href="http://www.kikt.top/tags/thymeleaf/">thymeleaf</a>
    
    <a href="http://www.kikt.top/tags/tips/">tips</a>
    
    <a href="http://www.kikt.top/tags/toast/">toast</a>
    
    <a href="http://www.kikt.top/tags/transition/">transition</a>
    
    <a href="http://www.kikt.top/tags/ui/">ui</a>
    
    <a href="http://www.kikt.top/tags/utf8/">utf8</a>
    
    <a href="http://www.kikt.top/tags/yield/">yield</a>
    
    <a href="http://www.kikt.top/tags/%E4%BA%8C%E8%BF%9B%E5%88%B6/">二进制</a>
    
    <a href="http://www.kikt.top/tags/%E4%BA%A4%E5%8F%89/">交叉</a>
    
    <a href="http://www.kikt.top/tags/%E4%BA%A4%E5%8F%89%E7%BC%96%E8%AF%91/">交叉编译</a>
    
    <a href="http://www.kikt.top/tags/%E4%BB%8B%E7%BB%8D/">介绍</a>
    
    <a href="http://www.kikt.top/tags/%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83/">代码规范</a>
    
    <a href="http://www.kikt.top/tags/%E5%86%B2%E7%AA%81/">冲突</a>
    
    <a href="http://www.kikt.top/tags/%E5%8A%A8%E6%80%81/">动态</a>
    
    <a href="http://www.kikt.top/tags/%E5%8F%91%E5%B8%83/">发布</a>
    
    <a href="http://www.kikt.top/tags/%E5%8F%AF%E6%89%A7%E8%A1%8C/">可执行</a>
    
    <a href="http://www.kikt.top/tags/%E5%9B%BE%E5%BA%8A/">图床</a>
    
    <a href="http://www.kikt.top/tags/%E5%9F%8E%E5%B8%82/">城市</a>
    
    <a href="http://www.kikt.top/tags/%E5%A4%A7%E6%96%87%E4%BB%B6/">大文件</a>
    
    <a href="http://www.kikt.top/tags/%E5%B7%A5%E5%85%B7/">工具</a>
    
    <a href="http://www.kikt.top/tags/%E5%B7%B2%E6%9C%89%E9%A1%B9%E7%9B%AE/">已有项目</a>
    
    <a href="http://www.kikt.top/tags/%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83/">开发环境</a>
    
    <a href="http://www.kikt.top/tags/%E6%80%BB%E7%BB%93/">总结</a>
    
    <a href="http://www.kikt.top/tags/%E6%85%A2/">慢</a>
    
    <a href="http://www.kikt.top/tags/%E6%89%93%E5%8C%85/">打包</a>
    
    <a href="http://www.kikt.top/tags/%E6%89%AB%E7%A0%81/">扫码</a>
    
    <a href="http://www.kikt.top/tags/%E6%8F%92%E4%BB%B6/">插件</a>
    
    <a href="http://www.kikt.top/tags/%E6%96%87%E6%A1%A3/">文档</a>
    
    <a href="http://www.kikt.top/tags/%E6%A8%A1%E6%9D%BF/">模板</a>
    
    <a href="http://www.kikt.top/tags/%E6%B8%B2%E6%9F%93/">渲染</a>
    
    <a href="http://www.kikt.top/tags/%E6%BA%90%E7%A0%81%E8%A7%A3%E6%9E%90/">源码解析</a>
    
    <a href="http://www.kikt.top/tags/%E7%81%B0%E5%BA%A6/">灰度</a>
    
    <a href="http://www.kikt.top/tags/%E7%82%B9%E5%87%BB/">点击</a>
    
    <a href="http://www.kikt.top/tags/%E7%84%A6%E7%82%B9/">焦点</a>
    
    <a href="http://www.kikt.top/tags/%E7%88%AC%E8%99%AB/">爬虫</a>
    
    <a href="http://www.kikt.top/tags/%E7%8A%B6%E6%80%81%E7%AE%A1%E7%90%86/">状态管理</a>
    
    <a href="http://www.kikt.top/tags/%E7%99%BE%E5%BA%A6%E5%9C%B0%E5%9B%BE/">百度地图</a>
    
    <a href="http://www.kikt.top/tags/%E7%BC%96%E7%A0%81/">编码</a>
    
    <a href="http://www.kikt.top/tags/%E7%BC%96%E7%A8%8B%E6%8A%80%E5%B7%A7/">编程技巧</a>
    
    <a href="http://www.kikt.top/tags/%E7%BC%96%E8%AF%91/">编译</a>
    
    <a href="http://www.kikt.top/tags/%E7%BF%BB%E8%AF%91/">翻译</a>
    
    <a href="http://www.kikt.top/tags/%E8%93%9D%E7%89%99/">蓝牙</a>
    
    <a href="http://www.kikt.top/tags/%E8%A1%A8%E5%8D%95/">表单</a>
    
    <a href="http://www.kikt.top/tags/%E8%B7%AF%E7%94%B1/">路由</a>
    
    <a href="http://www.kikt.top/tags/%E8%BF%87%E5%9C%BA%E5%8A%A8%E7%94%BB/">过场动画</a>
    
    <a href="http://www.kikt.top/tags/%E9%9A%90%E7%A7%81/">隐私</a>
    
</div>
    </section>

    
<section class="widget">
    <h3 class="widget-title">友情链接</h3>
    <ul class="widget-list">
        
        <li>
            <a target="_blank" href="https://github.com/Caijinglong" title="我的Github">我的Github</a>
        </li>
        
        <li>
            <a target="_blank" href="https://flutter.dev" title="flutter 官网">flutter 官网</a>
        </li>
        
    </ul>
</section>


    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="http://www.kikt.top/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
        </div>
    </div>
</div>
<footer id="footer">
    <div class="container">
        <div>
            <p>如果我的blog对您有帮助,而您愿意捐赠 😆, 可以用下面的二维码</p>
            <img style="width:5rem;" src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/bf4da1c1-1cfa-4f54-8a75-745cce2b737c/items?versionDescriptor%5Bversion%5D=master&versionDescriptor%5BversionOptions%5D=0&versionDescriptor%5BversionType%5D=0&resolveLfs=true&%24format=octetStream&api-version=5.0&path=%2F20190424141834.png"/>
            <img style="width:5rem; padding-left: 2rem;" 
            src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/bf4da1c1-1cfa-4f54-8a75-745cce2b737c/items?versionDescriptor%5Bversion%5D=master&versionDescriptor%5BversionOptions%5D=0&versionDescriptor%5BversionType%5D=0&resolveLfs=true&%24format=octetStream&api-version=5.0&path=%2F20190424141931.png"/>
            <img style="width:5rem; padding-left: 2rem;" 
            src="https://dev.azure.com/cjlspy/844861b8-ee45-48a3-b430-b974684baaaa/_apis/git/repositories/bf4da1c1-1cfa-4f54-8a75-745cce2b737c/items?versionDescriptor%5Bversion%5D=master&versionDescriptor%5BversionOptions%5D=0&versionDescriptor%5BversionType%5D=0&resolveLfs=true&%24format=octetStream&api-version=5.0&path=%2F20190424142013.png"/>
        </div>
        &copy; 2018 <a href="http://www.kikt.top">caijinglong的博客 By caijinglong</a>.
        Powered by <a rel="nofollow noreferer noopener" href="https://gohugo.io" target="_blank">Hugo</a>.
        <a href="http://www.flysnow.org/" target="_blank">Theme</a> based on <a href="https://github.com/rujews/maupassant-hugo" target="_blank">maupassant</a>.<br/>
        本站所有内容基于<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh" style="color:coral">CC4.0</a>协议发布,需要转载必须署名
        <br/>
        如果有问题可以<a href="mailto:cjl_spy@163.com">email联系我</a>
        <br/>
        京ICP备18038473号-1
        
    </div>
</footer>


    <script type="text/javascript" src="/js/prism.js" async="true"></script>
    <script type="text/javascript">
    
    (function(){
        $("pre code").parent().addClass("line-numbers")
    }())

    window.MathJax = {
        tex2jax: {
            inlineMath: [ ['$','$'] ],
            processEscapes: true
        }
    };
    </script>
    <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src="/js/totop.js?v=0.0.0" async=""></script>



<script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




</body>
</html>
